package com.mspbots.attendance.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.mspbots.attendance.enums.AttendanceTypeEnum;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author billb
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName(value = "tenant_user_attendances", autoResultMap = true)
public class Attendance extends TenantEntity {

    private Long tenantUserId;
    private String teamsUserId;
    private AttendanceTypeEnum type;
    private String tz;
    private String tzStr;
    private LocalDateTime logTime;
    private LocalDateTime logTimeUtc;
    private LocalDateTime createdTime;
    private String reason;
    private Boolean paid;
    private Integer duration;
    private Integer fromType;

    private transient String firstName;
    private transient String lastName;
    private transient String tenantName;


    @Builder
    public Attendance(Long tenantUserId, String teamsUserId, LocalDateTime logTimeUtc,
                      AttendanceTypeEnum type, String tz, String tzStr, LocalDateTime logTime,
                      LocalDateTime createdTime, String reason, Boolean paid, Integer duration, Integer fromType) {
        this.tenantUserId = tenantUserId;
        this.teamsUserId = teamsUserId;
        this.type = type;
        this.tz = tz;
        this.tzStr = tzStr;
        this.logTime = logTime;
        this.createdTime = createdTime;
        this.logTimeUtc = logTimeUtc;
        this.reason = reason;
        this.paid = paid;
        this.duration = duration;
        this.fromType = fromType;
    }
}
